/**
 * CS543 HW4 Joseph Meyer
 */
package edu.src.paging;

import java.util.ArrayList;
import java.util.List;

/**
 * There are 256 <code>PageTableEntry</code>s in a PageTable
 * Each <code>PageTableEntry</code> contains 256 <code>Page</code>s.
 * 
 * @author meyer
 */
public class PageTableEntry {
	
	private List<Page> pages;
	
	/**
	 * Instantiate the pages. 
	 */
	public PageTableEntry() {
		//setup null entries
		pages = new ArrayList<>(PageTable.TABLE_SIZE);
		for (int i = 0; i < PageTable.TABLE_SIZE; i++) {
			pages.add(new Page());
		}
	}
	
	/**
	 * Returns the <code>Page</code> that holds the
	 * frame and the invalid/valid bit info
	 * @param offset - between 0 and 255
	 * @return Page
	 */
	public Page getPageAt(int offset) {
		return pages.get(offset);
	}
}
